/*******************************************************************************
 * Copyright (c) 2018, 2018 GuoGuang Corporation and others.
 * All rights reserved. 
 *  
 * Create By Time 2018-2018年3月20日-下午3:35:10
 * Contributors:
 *     longshiyu
 * @longsy316@163.com
 *******************************************************************************/

package com.lsy.onehot.rnn.main;

import java.io.File;
import java.io.IOException;

import com.gg.lsy.ai.uitls.ini.ZztPropKit;
import com.lsy.onehot.rnn.qa.CurpusProcess;
import com.lsy.onehot.rnn.qa.MultiLayerNetworkOneHotNN;
import com.lsy.onehot.rnn.qa.OneHotProcess;

/**
 * @author Administrator
 * @time 2018 - 2018年3月20日 - 下午3:35:10
 * @desc Train2Vec.java
 */
public class Train2Vec {

	/**
	 * 
	 */
	public Train2Vec() {
		// TODO Auto-generated constructor stub
	}

	/**
	* @author longsy
	* @time : 20182018年3月20日下午3:35:10
	* @desc Train2Vec.java
	* @param args
	 * @throws Exception 
	*/
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub

		ZztPropKit.use(new File("oneshot/settings.properties") );
		
		boolean network_train_curpus = ZztPropKit.getBoolean("network.train.curpus") ;
		boolean network_train_model = ZztPropKit.getBoolean("network.train.model") ;

		System.out.println("network_train_curpus:"+ network_train_curpus ); 
		
		CurpusProcess cur = new CurpusProcess();
		cur.handleSigalDict(); 
		cur.handleDict() ;
		
		//
		OneHotProcess onehot = new OneHotProcess();
		onehot.setICurpusMateSet(cur);
		//训练语料向量 
		if(network_train_curpus)
			onehot.init(); 
		if(network_train_model){
			//训练使用
			MultiLayerNetworkOneHotNN oneHotNN = new MultiLayerNetworkOneHotNN();
			oneHotNN.setIOneHotProcess(onehot);
			oneHotNN.initialModel(cur.getInputNums() );
		}
		
	}

}
